//
//  Common.swift
//  SinaWeibo
//
//  Created by 李江波 on 2016/11/15.
//  Copyright © 2016年 lijiangbo. All rights reserved.
//

import UIKit

/// 申请应用时分配的AppKey
let client_id = "2564284185"

let client_secret = "c4749e10c1bd70c6ca43665d1b67351a"

/// 授权回调地址，站外应用需与设置的回调地址一致，站内应用需填写canvas page的地址
let redirect_uri = "http://www.baidu.com"


/// 改变根视图通知key
let ChangeRootViewController = "changeRootViewController"


/// 随机颜色
///
/// - Returns: 随机颜色
func arcColor() -> UIColor {

    let r = CGFloat(arc4random_uniform(256)) / 255.0
    let g = CGFloat(arc4random_uniform(256)) / 255.0
    let b = CGFloat(arc4random_uniform(256)) / 255.0
    
    return UIColor(red: r, green: g, blue: b, alpha: 1)

}


/// 屏幕宽度
let  kUISCRRENW = UIScreen.main.bounds.width
/// 屏幕高度
let kUISCRRENH = UIScreen.main.bounds.height
///导航栏高度
let navBarH : CGFloat = 64

//定义全局的时间格式化  (很耗性能， 要全局创造一次就好)
let dateFormater = DateFormatter()

//正则表达式
let atSomeRegex = try! NSRegularExpression(pattern: "@\\w+", options: [])
let topicRegex = try! NSRegularExpression(pattern: "#.*?#", options: [])
let urlRegex = try! NSRegularExpression(pattern: "(http|ftp|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&amp;:/~\\+#]*[\\w\\-\\@?^=%&amp;/~\\+#])?", options: [])
let emoticonRegex = try! NSRegularExpression(pattern: "\\[.*?\\]", options: [])





